package com.zhuidian.mothernote.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.recyclerview.widget.RecyclerView.ViewHolder;

import com.base.adapter.BaseRecyclerAdapter;
import com.zhuidian.mothernote.R;
import com.zhuidian.mothernote.bean.CommentBean;


public class QuestionCommentAdapter extends BaseRecyclerAdapter<CommentBean> {

    public QuestionCommentAdapter(Context context) {
        super(context);
    }

    @Override
    protected ViewHolder onCreateItemViewHolder(ViewGroup parent) {
        return new MyViewHolder(inflate(R.layout.adapter_question_comment));
    }

    public class MyViewHolder extends ItemViewHolder {
        private ImageView iv_headimage;
        private TextView tv_name;
        private TextView tv_like;
        private TextView tv_time;
        private TextView tv_reply;
        private TextView tv_comment;

        public MyViewHolder(View view) {
            super(view);
            iv_headimage = (ImageView) view.findViewById(R.id.iv_headimage);
            tv_name = (TextView) view.findViewById(R.id.tv_name);
            tv_like = (TextView) view.findViewById(R.id.tv_like);
            tv_time = (TextView) view.findViewById(R.id.tv_time);
            tv_reply = (TextView) view.findViewById(R.id.tv_reply);
            tv_comment =(TextView)  view.findViewById(R.id.tv_comment);
        }

        @Override
        protected void setListener(int position) {

        }

        @Override
        protected void initValue(int position, CommentBean commentBean) {
               tv_name.setText(commentBean.getName());
               tv_like.setText(commentBean.getLike());
               tv_reply.setText(commentBean.getTime());
               tv_time.setText(commentBean.getTime());
            tv_comment.setText(commentBean.getComment());
        }
    }
}


